//
//  OnePlatformCell.m
//  reSearchDemo
//
//  Created by 科技 on 15/9/30.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "OnePlatformCell.h"
#import "UIImageView+WebCache.h"
#import "UIView+Layer.h"
#import "OnePlatformModel.h"
@interface OnePlatformCell() {
    UIImageView *headImageView;
    UILabel  *nameLabel;
//    UILabel  *stateLabel;
}

@end

@implementation OnePlatformCell

- (void)awakeFromNib {
    // Initialization code
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        headImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:headImageView];
        nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:nameLabel];
//        stateLabel = [[UILabel alloc] init];
//        [self.contentView addSubview:stateLabel];
    }
    return self;
}

- (void)setModel:(OnePlatformModel *)model {
    headImageView.frame = CGRectMake(10, 10, 40, 40);
    [headImageView sd_setImageWithUrlString:model.headImage placeholderImage:[UIImage imageNamed:@"about_icon"]];
    [UIView SetRoundedCorners:headImageView andcornerRadius:CGRectGetWidth(headImageView.frame)/2 andborderWidth:1.0 andborderColor:[UIColor clearColor]];
    
    nameLabel.frame = CGRectMake(CGRectGetMaxX(headImageView.frame) + 5, CGRectGetMinY(headImageView.frame) + 10, 200, 20);
    nameLabel.text = model.name;
    
//    stateLabel.frame = CGRectMake(CGRectGetWidth(self.frame) - 80, CGRectGetMinY(headImageView.frame) + 10, 60, 20);
//    stateLabel.text = model.state;
    
//    model.height = @"60";
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
